package com.cloud.wms.ui.in.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.cloud.wms.ui.main.entity.CommodityEntity;
import com.cloud.wms.ui.main.entity.MemberEntity;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * @Author:Chen
 * @Date: 2021-01-19 16:47
 * @Description:
 */
public class InOrderEntity extends MemberEntity implements Parcelable {

    /**
     * inID : 1
     * inCode : SYNC2000000021
     * skuAmount : 1
     * totalAmount : 6
     * inTypeName : 采购入库
     * createDate : 2021-01-23T12:01:51
     * memberID : 23537
     * memberNo : null
     */

    private long inID;
    private String inCode;
    private String skuAmount;
    private String totalAmount;
    private String inTypeName;
    private String createDate;
    private String warehouseAreaID;
    private List<CommodityEntity> commodityEntityList;


    public List<CommodityEntity> getCommodityEntityList() {
        return commodityEntityList;
    }

    public void setCommodityEntityList(List<CommodityEntity> commodityEntityList) {
        this.commodityEntityList = commodityEntityList;
    }

    public String getWarehouseAreaID() {
        return warehouseAreaID;
    }

    public void setWarehouseAreaID(String warehouseAreaID) {
        this.warehouseAreaID = warehouseAreaID;
    }

    public long getInID() {
        return inID;
    }

    public void setInID(long inID) {
        this.inID = inID;
    }

    public String getInCode() {
        return inCode == null ? "" : inCode;
    }

    public void setInCode(String inCode) {
        this.inCode = inCode;
    }

    public String getSkuAmount() {
        return skuAmount == null ? "" : skuAmount;
    }

    public void setSkuAmount(String skuAmount) {
        this.skuAmount = skuAmount;
    }

    public String getTotalAmount() {
        return totalAmount == null ? "" : totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getInTypeName() {
        return inTypeName == null ? "" : inTypeName;
    }

    public void setInTypeName(String inTypeName) {
        this.inTypeName = inTypeName;
    }

    public String getCreateDate() {
        return createDate == null ? "" : createDate.replace("T", " ");
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public InOrderEntity() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeLong(this.inID);
        dest.writeString(this.inCode);
        dest.writeString(this.skuAmount);
        dest.writeString(this.totalAmount);
        dest.writeString(this.inTypeName);
        dest.writeString(this.createDate);
        dest.writeString(this.warehouseAreaID);
        dest.writeTypedList(this.commodityEntityList);
    }

    protected InOrderEntity(Parcel in) {
        super(in);
        this.inID = in.readLong();
        this.inCode = in.readString();
        this.skuAmount = in.readString();
        this.totalAmount = in.readString();
        this.inTypeName = in.readString();
        this.createDate = in.readString();
        this.warehouseAreaID = in.readString();
        this.commodityEntityList = in.createTypedArrayList(CommodityEntity.CREATOR);
    }

    public static final Creator<InOrderEntity> CREATOR = new Creator<InOrderEntity>() {
        @Override
        public InOrderEntity createFromParcel(Parcel source) {
            return new InOrderEntity(source);
        }

        @Override
        public InOrderEntity[] newArray(int size) {
            return new InOrderEntity[size];
        }
    };
}
